package com.xposed.aliproxy.thread;

import android.app.Activity;
import android.view.View;
import android.widget.TextView;

import com.xposed.aliproxy.R;
import com.xposed.aliproxy.qrcode.GlobalInstance;

/* renamed from: h.c */
public class RefreshFloatBallThread extends Thread {
    /* renamed from: a */
    private Activity f1790a;
    /* renamed from: b */
    private TextView f1791b;

    /* compiled from: RefreshFloatBallThread */
    /* renamed from: h.c$1 */
    class C05241 implements Runnable {
        C05241() {
        }

        public void run() {
            if (RefreshFloatBallThread.this.f1791b == null) {
                RefreshFloatBallThread.this.f1791b = (TextView) RefreshFloatBallThread.this.f1790a.findViewById(R.id.title_right_right2);
                RefreshFloatBallThread.this.f1791b.setVisibility(View.VISIBLE);
            }
            if (GlobalInstance.getInstance().f1765d) {
                RefreshFloatBallThread.this.f1791b.setTextColor(-16711936);
                RefreshFloatBallThread.this.f1791b.setText("在线");
                return;
            }
            RefreshFloatBallThread.this.f1791b.setTextColor(-65536);
            RefreshFloatBallThread.this.f1791b.setText("离线");
        }
    }

    public RefreshFloatBallThread(Activity activity) {
        this.f1790a = activity;
    }

    public void run() {
        super.run();
        while (true) {
            try {
                this.f1790a.runOnUiThread(new C05241());
                Thread.sleep(2000);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}
